import http from "@/utils/request"

// 获取学员信息
export const getStudentInfo = (page = 1, count = 10, classes = "") => http.get("/students/getstulist", {
    params: {
        page,
        count,
        class: classes
    }
})

//增加学员信息
export const addStuInfo = data => http.post("/students/addstu", data)

//修改学员信息
export const updateStuInfo = data => http.post("/students/updatestu", data)

//删除学员信息
export const delStuInfo = (sId) => http.get("/students/delstu", {
    params: {
        sId
    }
})

//获取班级列表
export const getClassList = () => http.get("/students/getclasses")

//搜索学员
export const searchStu = (page, key, count) => {
    //短路运算
    page = page || 1
    key = key || ""
    count = count || 10
    return http.get("/students/searchstu", {
        params: {
            page,
            key,
            count
        }
    })
}